// 统一管理所有的状态变量
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:testlzhu/page/mingepage/mingepage_view.dart';
import 'package:testlzhu/page/one_page/one_page_view.dart';
import 'package:testlzhu/page/two_page/two_page_view.dart';
import 'package:testlzhu/utils/util.dart';

class MainState {
  late int count;

  int currentIndex = 0;

  late Widget bottom;

  final items = [
    BottomNavigationBarItem(
        icon: Image.asset(
          "assets/images/ic_home_index_select.png",
          width: 20,
          height: 20,
        ),
        label: "首页",
        activeIcon: Image.asset(
          Util.getImgPath("ic_home_index_select"),
          width: 20,
          height: 20,
        )),
    BottomNavigationBarItem(
        icon: Image.asset(
          "assets/images/ic_home_community.png",
          width: 20,
          height: 20,
        ),
        label: "圈子",
        activeIcon: Image.asset(
          Util.getImgPath("ic_home_community_select"),
          width: 20,
          height: 20,
        )),
    BottomNavigationBarItem(icon: Image.asset("assets/images/ic_home_publish.png", width: 40, height: 40), label: ""),
    BottomNavigationBarItem(
        icon: Image.asset(
          "assets/images/ic_home_msg.png",
          width: 20,
          height: 20,
        ),
        label: "消息",
        activeIcon: Image.asset(
          Util.getImgPath("ic_home_msg_select"),
          width: 20,
          height: 20,
        )),
    BottomNavigationBarItem(
        icon: Image.asset(
          "assets/images/ic_home_mine.png",
          width: 20,
          height: 20,
        ),
        label: "我的",
        activeIcon: Image.asset(
          Util.getImgPath("ic_home_mine_select"),
          width: 20,
          height: 20,
        ))
  ];

  final List<Widget> pageviews = [
    const HomePageWidget(),
    const OnePageWidget(),
    Container(
      color: Colors.blue,
      child: const Center(
          child: Text(
        "第二页",
        style: TextStyle(fontSize: 18),
      )),
    ),
    Container(
      color: Colors.blue,
      child: const Center(
          child: Text(
        "第三页",
        style: TextStyle(fontSize: 18),
      )),
    ),
    const MingepageWidget(),
  ];

  var normalImgUrls = [
    Util.getImgPath("ic_home_index"),
    Util.getImgPath("ic_home_community"),
    Util.getImgPath("ic_home_publish"),
    Util.getImgPath("ic_home_msg"),
    Util.getImgPath("ic_home_mine"),
  ];
  var selectedImgUrls = [
    Util.getImgPath("ic_home_index_select"),
    Util.getImgPath("ic_home_community_select"),
    Util.getImgPath("ic_home_publish"),
    Util.getImgPath("ic_home_msg_select"),
    Util.getImgPath("ic_home_mine_select"),
  ];

  var titles = ["首页", '圈子', '', '消息', '我的'];

  MainState() {
    count = 0;
  }
}
